- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Includes
Certificate & Practice Material
Programs for practice
In the program below, we've introduced beginers to programming in C
Source Code: Program to find sum of matrices
# Program to find sum of matrices in C
#include<stdio.h>
void main()
{
int A[3][3],B[3][3],C[3][3],i,j;
printf("write input for 1st 2D array");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&A[i][j]);
}
printf("write input for 2nd 2D array");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&B[i][j]);
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
C[i][j]=A[i][j]+B[i][j];
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%d\n",C[i][j]);
}
}
Output
Run the program to see the OUTPUT